﻿using CRMFramework;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CRMWeb.Pages
{
    public partial class TestSuccessAppData : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            SelectData();
        }

        public void SelectData()
        {
            DataTable dt;
            try
            {
                
                string sqlqry = "select * from app_info order by app_id desc limit 1";
                dt = DBhelper.ExecuteDataset(sqlqry).Tables[0];
                foreach (DataRow dr in dt.Rows)
                {
                    lblFirstName1.Text = dr["app_FirstName1"].ToString();
                    lblMiddleName1.Text = dr["app_MiddleName1"].ToString();
                    lblSurname1.Text = dr["app_Surname1"].ToString();
                    lblLoanAmount1.Text = dr["app_LoanAmount"].ToString();
                    lblResidency1.Text = dr["app_Residency"].ToString();
                    lblMobile1.Text = dr["app_Mobile1"].ToString();
                    lblPhone1.Text = dr["app_Phone1"].ToString();
                    lblEMailAddress1.Text = dr["app_EMailAddress1"].ToString();
                    lblResidentialAddress1.Text = dr["app_ResidentialAddress1"].ToString();
                    lblDateOfBirth1.Text = dr["app_DateOfBirth1"].ToString();
                    lblDriversLicence1.Text = dr["app_DriversLicence1"].ToString();
                    lblResidentialStatus1.Text = dr["app_ResidentialStatus1"].ToString();
                    lblBoardingWithName1.Text = dr["app_BoardingWithName1"].ToString();
                    lblLengthOfResidenceYear1.Text = dr["app_LengthOfResidenceYear1"].ToString();
                    lblResidencePeriod1.Text = dr["app_ResidencePeriod1"].ToString();
                    lblNumberofDependant1.Text = dr["app_NumberofDependant1"].ToString();
                    lblPurposeOfLoan1.Text = dr["app_PurposeOfLoan1"].ToString();
                    lblOtherPurpose1.Text = dr["app_otherpurpose"].ToString();
                    lblPurposeSummary1.Text = dr["app_PurposeSummary"].ToString();
                    lblTypeOfEmployment1.Text = dr["app_TypeOfEmployment1"].ToString();
                    lblBusinessName1.Text = dr["app_BusinessName1"].ToString();
                    lblAddress1.Text = dr["app_Address1"].ToString();
                    lblAbnNumber1.Text = dr["app_AbnNumber1"].ToString();
                    lblNatureOfBusiness1.Text = dr["app_NatureOfBusiness1"].ToString();
                    lblMoneyDetail1.Text = dr["app_moneydetail1"].ToString();
                    lblNameOfDirectors1.Text = dr["app_NameOfDirectors1"].ToString();
                    lblIncomeAfterTax1.Text = dr["app_IncomeAfterTax1"].ToString();
                    lblIncomeAfterTax1Period1.Text = dr["app_incomeAfterTax1Period"].ToString();
                    lblCentrelinkIncome1.Text = dr["app_CentrelinkIncome1"].ToString();
                    lblOtherIncomeSpecify1.Text = dr["app_OtherIncomeSpecify1"].ToString();
                    lblRentalIncome1.Text = dr["app_RentalIncome1"].ToString();
                    lblTotalIncome1.Text = dr["app_TotalIncome"].ToString();
                    lblVehicle1Value1.Text = dr["app_Vehicle1Value"].ToString();
                    lblVehicle1Payment1.Text = dr["app_Vehicle1Payment"].ToString();
                    lblVehicle1Owner1.Text = dr["app_Vehicle1Owner"].ToString();
                    lblProperty1Address1.Text = dr["app_Property1Address"].ToString();
                    lblProperty1LandSize1.Text = dr["app_Property1LandSize"].ToString();
                    lblBrowser1.Text = dr["app_browser"].ToString();
                    lblIpAddress1.Text = dr["app_ipaddress"].ToString();
                    lblReferrerName1.Text = dr["app_referrerName"].ToString();
                    lblReferrerCompany1.Text = dr["app_referrerCompany"].ToString();
                    lblReferrerEmail1.Text = dr["app_referrerEmail"].ToString();
                    lblStatus1.Text = dr["app_status"].ToString();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }

        protected void btnBack_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Pages/Test/TestInsertAppDataConsumer.aspx");
        }
    }
}